<script lang="ts" setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';

import { ModernAuthenticationRegister } from '@vben/common-ui';
import { ModernAuthLayout } from '@vben/layouts';

defineOptions({ name: 'Register' });

const router = useRouter();
const loading = ref(false);

function handleSubmit(value: any) {
  console.log('register submit:', value);
  loading.value = true;

  // 模拟注册请求
  setTimeout(() => {
    loading.value = false;
    // 跳转到注册成功页面
    router.push('/auth/register-success');
  }, 2000);
}
</script>

<template>
  <ModernAuthLayout
    app-name="工作平台"
    page-title="欢迎注册工作平台"
    page-description="加入我们，开启高效工作之旅"
  >
    <ModernAuthenticationRegister :loading="loading" @submit="handleSubmit" />
  </ModernAuthLayout>
</template>
